<?php

use yii\db\Migration;
use yii\db\Schema;

class m170721_093319_ADD_TABLE_FINANCE_IMG extends Migration
{
    public function up()
    {

        $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';

        // 财务审批发票 合同 图片存储表
        $this->createTable('finance_img', [
            "id" =>         Schema::TYPE_PK,
            "finance_id" =>	Schema::TYPE_INTEGER.   "(11) NULL  COMMENT '对应订单ID'",
            "img" =>        Schema::TYPE_STRING.   "(128) NULL COMMENT '图片文件地址'",
        ], $tableOptions);


    }

    public function down()
    {
        echo "m170721_093319_ADD_TABLE_FINANCE_IMG cannot be reverted.\n";

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
